import { fetchWrapper } from "@/app/cg06/api/common";

export function getCodeApi() {
  return fetchWrapper<{
    captchaEnabled: boolean;
    img: string;
    uuid: string;
  }>(`/code`, undefined, "GET", {
    tokenRequired: false,
  });
}

export function loginApi(data: {
  username: string;
  password: string;
  code: string;
  uuid: string;
}) {
  return fetchWrapper<{
    access_token: string;
  }>(`/auth/login`, data, "POST", {
    tokenRequired: false,
  });
}

/**
 * 获取 wms token
 * @returns 
 */
export function getWarehouseAuthTokenApi() {
  return fetchWrapper<{
    access_token: string;
  }>(`/big-screen/screen/businessIndicator/getWarehouseAuthToken?userName=SIXZONEHALL`, undefined, "GET", {
    tokenRequired: false,
  });
}
